<?PHP
  $current_page = "event_edit.php";
  $page_type = "S";
  require_once 'header.php';
?>
	<div id="page">
	  <div id="page-padding">
        <!-- start content -->	    
	    <div id="content">
	      <div id="content-padding">
            <h1>Remove Event</h1>
            <p>
			<?PHP
				if(isset($_GET['eid']))
					$old_eid = $_GET['eid'];
				if(isset($_GET['uid']))
					$old_uid = $_GET['uid'];
				
				$whereclause = "1=1";
				
				if (isset($old_eid) and trim($old_eid) != "")
					$whereclause .= " and eventid = '$old_eid'";
				if (isset($old_uid) and trim($old_uid) != "")
					$whereclause .= " and userid = '$old_uid'";
					
				$sql = "delete from EVENT where $whereclause";
				$result_array = execute_sql_in_oracle($sql);
				$result = $result_array["flag"];
				$cursor = $result_array["cursor"];
				if(!$result){
					$removal_error = "<br>Event '$old_eid' removal failed.<br>";
					$sql = "rollback";
					$result_array = execute_sql_in_oracle($sql);
					header("Location:event.php?removal_error=$removal_error");
				}
				else {
					echo("Removal Successful!");
					$sql = "commit";
					$result_array = execute_sql_in_oracle($sql);
				}
			?>
			</p>
	      </div>
		</div>
	  <!-- end content --></div>
	  <div id="footer">
	    <div id="footer-pad">
	      <div class="line"></div>
		  <!-- footer and copyright notice -->
	      <p>Design by <a href="http://www.steves-templates.com">Steve's free website templates</a>.</p>
		  <!-- end footer and copyright notice -->
	    </div>
	  </div>
	</div>
  </body>
</html>